<template>
  <header class="header">
    <h1>todos</h1>
    <input
      class="new-todo"
      autofocus
      autocomplete="off"
      placeholder="What needs to be done?"
      @keydown.enter="addTodo"
    />
  </header>
</template>

<script setup>
import { defineEmits } from "vue";
let emit = defineEmits(["addTodo"]);

let addTodo = (e) => {
  emit("addTodo", e.target.value);
  e.target.value = "";
};
</script>